from ultralytics import YOLO
 
CFG = r"D:\Desktop\cfg files\01-YOLOv8.pt"
dataset = r"D:\Desktop\Dataset\display\dataset.yaml"
 

model = YOLO(CFG) 

metrics = model.val(data=dataset,
                    split='val',
                    plots = True,
                    save_txt = True,
                    workers = 0,
                    project = r'D:\Desktop\results\pred',
                    name = 'pred',
                    ) 